home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 4 / Eagles_Nest_Mac_Collection_Disc_4.TOAST / Word Processing / WordRefBib / WordRef Stack 1.3 / background_13702.txt < prev    next >
Text File  |  1989-12-16  |  12KB  |  517 lines

  1. -- background: 13702 from stack: in.3
  2. -- bmap block id: 4517
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Instruction
  6. ----- HyperTalk script -----
  7. on openBackground
  8.   global dontCheckFields
  9.   -- Should really be in the openStack handler, but, at least for me,
  10.   -- this never gets executed!?!
  11.   if the short version of HyperCard < 1.2 then
  12.     answer "This stack needs HyperCard 1.2 or later to run." with "Sorry"
  13.     go home
  14.   end if
  15.   show menubar
  16.   hide msg box
  17.   put false into dontCheckFields
  18.   pass openBackground
  19. end openBackground
  20.  
  21. on closeCard
  22.   hideStrings
  23. end closeCard
  24.  
  25. on showStrings
  26.   lock screen
  27.   show bg btn "Strings"
  28.   show bg btn "stringsGoAway"
  29.   show bg fld "strings"
  30.   unlock screen with barn door open
  31.   select before text of bg fld "strings"
  32. end showStrings
  33.  
  34. on hideStrings
  35.   if the visible of bg fld "strings" then
  36.     lock screen
  37.     hide bg fld "strings"
  38.     hide bg btn "Strings"
  39.     hide bg btn "stringsGoAway"
  40.     unlock screen with barn door close
  41.   end if
  42. end hideStrings
  43.  
  44.  
  45.  
  46. -- part 85 (field)
  47. -- low flags: 01
  48. -- high flags: 0000
  49. -- rect: left=288 top=162 right=177 bottom=337
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 0
  53. -- font id: 3
  54. -- text size: 10
  55. -- style flags: 0
  56. -- line height: 13
  57. -- part name: version
  58.  
  59.  
  60. -- part 80 (button)
  61. -- low flags: 00
  62. -- high flags: A004
  63. -- rect: left=205 top=305 right=335 bottom=307
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 1
  67. -- font id: 0
  68. -- text size: 12
  69. -- style flags: 0
  70. -- line height: 16
  71. -- part name: Write BibTeX…
  72. ----- HyperTalk script -----
  73. on mouseUp
  74.   global gFileName, dontCheckFields
  75.  
  76.   put rawFileName(gFileName) into rawFile
  77.   if rawFile is empty
  78.   then put the short name of this stack & ".bib" into rawFile
  79.   put StdFile(put, "Save to BibTeX file:", rawFile) into newFile
  80.   if newFile is empty then exit mouseUp
  81.   answer "Is this for use with WordRef?" with "Cancel" or "Other BibTeX" or "WordRef"
  82.   put it into doWordRef
  83.   if it is "Cancel" then exit mouseUp
  84.   if it is "WordRef" then
  85.     answer "Is the stack already sorted?" with "No" or "Yes"
  86.     if it is "No" then
  87.       put "Sorting‚Ķ"
  88.       sort by field "keyField"
  89.     end if
  90.   end if
  91.   set cursor to watch
  92.   put newFile into gFileName
  93.   lock screen
  94.   put true into dontCheckFields
  95.   WriteBibTeX gFileName, doWordRef, "no"
  96.   put false into dontCheckFields
  97.   unlock screen
  98.   hide msg box
  99. end mouseUp
  100.  
  101. -- returns the "short" name of a file name
  102. function rawFileName fileName
  103. put offset(":",fileName) into index
  104. repeat while index <> 0
  105.   put the number of chars of fileName into numChars
  106.   put char index+1 to numChars of fileName into fileName
  107.   put offset(":",fileName) into index
  108. end repeat
  109. return fileName
  110. end rawFileName
  111.  
  112.  
  113.  
  114.  
  115. -- part 82 (button)
  116. -- low flags: 00
  117. -- high flags: 2004
  118. -- rect: left=8 top=246 right=286 bottom=48
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 8538 / 8538
  121. -- text alignment: 1
  122. -- font id: 0
  123. -- text size: 12
  124. -- style flags: 0
  125. -- line height: 16
  126. -- part name: Find
  127. ----- HyperTalk script -----
  128. on mouseUp
  129.   doMenu "Find..."
  130. end mouseUp
  131.  
  132.  
  133.  
  134. -- part 84 (button)
  135. -- low flags: 00
  136. -- high flags: A004
  137. -- rect: left=407 top=305 right=335 bottom=464
  138. -- title width / last selected line: 0
  139. -- icon id / first selected line: 0 / 0
  140. -- text alignment: 1
  141. -- font id: 0
  142. -- text size: 12
  143. -- style flags: 0
  144. -- line height: 16
  145. -- part name: Clear…
  146. ----- HyperTalk script -----
  147. on mouseUp
  148.   answer "Really delete all references from the stack?" with "Yes" or "No"
  149.   if it is "No" then exit mouseUp
  150.   set cursor to watch
  151.   lock screen
  152.   put the id of this card into myself
  153.   put empty into bg field "Strings"
  154.   go next
  155.   repeat until the id of this card is myself
  156.     -- clear the card if it's the last of its kind
  157.     if the number of cds of this bg = 1 then
  158.       repeat with i = 1 to the number of bg flds
  159.         put empty into bg field i
  160.       end repeat
  161.       go next
  162.     else
  163.       doMenu "Delete Card"
  164.     end if
  165.   end repeat
  166.   unlock screen
  167. end mouseUp
  168.  
  169.  
  170.  
  171. -- part 86 (field)
  172. -- low flags: 01
  173. -- high flags: 0001
  174. -- rect: left=107 top=45 right=82 bottom=456
  175. -- title width / last selected line: 0
  176. -- icon id / first selected line: 0 / 0
  177. -- text alignment: 1
  178. -- font id: 20
  179. -- text size: 24
  180. -- style flags: 256
  181. -- line height: 32
  182. -- part name: Title
  183.  
  184.  
  185. -- part 87 (button)
  186. -- low flags: 00
  187. -- high flags: A004
  188. -- rect: left=205 top=273 right=303 bottom=307
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: Read BibTeX…
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.   global dontCheckFields
  200.  
  201.   put StdFile(get, "TEXT") into inFile
  202.   if inFile is empty then exit mouseUp
  203.   set cursor to watch
  204.   lock screen
  205.   put true into dontCheckFields
  206.   ReadBibTeX inFile
  207.   if the result is not empty then answer the result with "OK"
  208.   put false into dontCheckFields
  209.   put "Sorting..."
  210.   sort by fld "keyField"
  211.   unlock screen
  212.   hide msg box
  213. end mouseUp
  214.  
  215.  
  216.  
  217. -- part 89 (button)
  218. -- low flags: 00
  219. -- high flags: A004
  220. -- rect: left=311 top=273 right=303 bottom=464
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 0 / 0
  223. -- text alignment: 1
  224. -- font id: 0
  225. -- text size: 12
  226. -- style flags: 0
  227. -- line height: 16
  228. -- part name: Find Duplicate Keys
  229. ----- HyperTalk script -----
  230. on mouseUp
  231.   set cursor to watch
  232.   lock screen
  233.   sort by bg fld "keyField"
  234.   put empty into dupKeys
  235.   put the id of this cd into myself
  236.   go card 15
  237.   put empty into lastKey
  238.   repeat until the id of this cd is myself
  239.     if bg fld "keyField" = lastKey then
  240.       put lastKey & " " after dupKeys
  241.     end if
  242.     put bg fld "keyField" into lastKey
  243.     go next
  244.   end repeat
  245.   unlock screen
  246.   if dupKeys is empty
  247.   then put "No duplicates"
  248. else put "Duplicates:" && dupKeys
  249. end mouseUp
  250.  
  251.  
  252.  
  253. -- part 88 (button)
  254. -- low flags: 00
  255. -- high flags: 2004
  256. -- rect: left=8 top=204 right=244 bottom=48
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 32462 / 32462
  259. -- text alignment: 1
  260. -- font id: 0
  261. -- text size: 12
  262. -- style flags: 0
  263. -- line height: 16
  264. -- part name: Help
  265. ----- HyperTalk script -----
  266. on mouseUp
  267.   show cd fld "Help Field"
  268. end mouseUp
  269.  
  270.  
  271.  
  272. -- part 90 (button)
  273. -- low flags: 00
  274. -- high flags: 2000
  275. -- rect: left=70 top=17 right=57 bottom=110
  276. -- title width / last selected line: 0
  277. -- icon id / first selected line: 24830 / 24830
  278. -- text alignment: 1
  279. -- font id: 0
  280. -- text size: 12
  281. -- style flags: 0
  282. -- line height: 16
  283. -- part name: Next
  284. ----- HyperTalk script -----
  285. on mouseUp
  286.   lock screen
  287.   go card 15
  288.   --  put the id of this cd into myself
  289.   --  go next
  290.   --  repeat until the id of this cd is myself
  291.   --    if bg fld "keyField" is not empty then exit mouseUp
  292.   --    go next
  293.   --  end repeat
  294. end mouseUp
  295.  
  296.  
  297.  
  298. -- part 91 (button)
  299. -- low flags: 00
  300. -- high flags: A004
  301. -- rect: left=311 top=305 right=335 bottom=403
  302. -- title width / last selected line: 0
  303. -- icon id / first selected line: 0 / 0
  304. -- text alignment: 1
  305. -- font id: 0
  306. -- text size: 12
  307. -- style flags: 0
  308. -- line height: 16
  309. -- part name: New Stack…
  310. ----- HyperTalk script -----
  311. on mouseUp
  312.   put the short name of this stack into source
  313.   put StdFile(put, "Save a Copy:","Copy of"&&source) into dest
  314.   if dest is empty then exit mouseUp
  315.   set cursor to watch
  316.   put word 2 of the long name of this stack into source
  317.   put char 2 to number of chars of source - 1 of source into source
  318.   CopyFile source,dest
  319.   if the result is not empty then
  320.     put "Error in copy:" && the result
  321.     exit mouseUp
  322.   end if
  323.   go dest
  324. end mouseUp
  325.  
  326.  
  327.  
  328. -- part 93 (button)
  329. -- low flags: 00
  330. -- high flags: 2004
  331. -- rect: left=8 top=36 right=76 bottom=48
  332. -- title width / last selected line: 0
  333. -- icon id / first selected line: 20098 / 20098
  334. -- text alignment: 1
  335. -- font id: 0
  336. -- text size: 12
  337. -- style flags: 0
  338. -- line height: 16
  339. -- part name: Home
  340. ----- HyperTalk script -----
  341. on mouseUp
  342.   visual iris close
  343.   go home
  344. end mouseUp
  345.  
  346.  
  347.  
  348. -- part 94 (button)
  349. -- low flags: 00
  350. -- high flags: 2004
  351. -- rect: left=8 top=78 right=118 bottom=48
  352. -- title width / last selected line: 0
  353. -- icon id / first selected line: 3430 / 3430
  354. -- text alignment: 1
  355. -- font id: 0
  356. -- text size: 12
  357. -- style flags: 0
  358. -- line height: 16
  359. -- part name: New Item
  360. ----- HyperTalk script -----
  361. on mouseDown
  362.   NewItem 0
  363. end mouseDown
  364.  
  365.  
  366.  
  367. -- part 95 (button)
  368. -- low flags: 00
  369. -- high flags: 2004
  370. -- rect: left=8 top=120 right=160 bottom=48
  371. -- title width / last selected line: 0
  372. -- icon id / first selected line: 20186 / 20186
  373. -- text alignment: 1
  374. -- font id: 0
  375. -- text size: 12
  376. -- style flags: 0
  377. -- line height: 16
  378. -- part name: Sort Items
  379. ----- HyperTalk script -----
  380. on mouseUp
  381.   sort by fld "keyField"
  382. end mouseUp
  383.  
  384.  
  385.  
  386. -- part 96 (button)
  387. -- low flags: 00
  388. -- high flags: 2004
  389. -- rect: left=8 top=162 right=202 bottom=48
  390. -- title width / last selected line: 0
  391. -- icon id / first selected line: 32670 / 32670
  392. -- text alignment: 1
  393. -- font id: 0
  394. -- text size: 12
  395. -- style flags: 0
  396. -- line height: 16
  397. -- part name: Scan Items
  398. ----- HyperTalk script -----
  399. on mouseUp
  400.   show all cds
  401. end mouseUp
  402.  
  403.  
  404.  
  405. -- part 98 (field)
  406. -- low flags: 80
  407. -- high flags: 0007
  408. -- rect: left=107 top=99 right=258 bottom=454
  409. -- title width / last selected line: 0
  410. -- icon id / first selected line: 0 / 0
  411. -- text alignment: 0
  412. -- font id: 21
  413. -- text size: 10
  414. -- style flags: 0
  415. -- line height: 13
  416. -- part name: Strings
  417.  
  418.  
  419. -- part 99 (button)
  420. -- low flags: 80
  421. -- high flags: 8002
  422. -- rect: left=107 top=78 right=100 bottom=454
  423. -- title width / last selected line: 0
  424. -- icon id / first selected line: 0 / 0
  425. -- text alignment: 1
  426. -- font id: 3
  427. -- text size: 12
  428. -- style flags: 0
  429. -- line height: 16
  430. -- part name: Strings
  431.  
  432.  
  433. -- part 100 (button)
  434. -- low flags: 80
  435. -- high flags: 2005
  436. -- rect: left=109 top=81 right=97 bottom=129
  437. -- title width / last selected line: 0
  438. -- icon id / first selected line: 0 / 0
  439. -- text alignment: 1
  440. -- font id: 0
  441. -- text size: 12
  442. -- style flags: 0
  443. -- line height: 16
  444. -- part name: stringsGoAway
  445. ----- HyperTalk script -----
  446. on mouseUp
  447.   set the highlight of me to false
  448.   hideStrings
  449. end mouseUp
  450.  
  451.  
  452.  
  453. -- part 101 (button)
  454. -- low flags: 00
  455. -- high flags: 2004
  456. -- rect: left=8 top=288 right=328 bottom=48
  457. -- title width / last selected line: 0
  458. -- icon id / first selected line: 20965 / 20965
  459. -- text alignment: 1
  460. -- font id: 0
  461. -- text size: 12
  462. -- style flags: 0
  463. -- line height: 16
  464. -- part name: Edit Strings
  465. ----- HyperTalk script -----
  466. on mouseUp
  467.   showStrings
  468. end mouseUp
  469.  
  470.  
  471.  
  472. -- part 102 (button)
  473. -- low flags: 00
  474. -- high flags: A004
  475. -- rect: left=96 top=273 right=303 bottom=201
  476. -- title width / last selected line: 0
  477. -- icon id / first selected line: 0 / 0
  478. -- text alignment: 1
  479. -- font id: 0
  480. -- text size: 12
  481. -- style flags: 0
  482. -- line height: 16
  483. -- part name: Read Strings…
  484. ----- HyperTalk script -----
  485. on mouseUp
  486.   put StdFile(get, "TEXT") into inFile
  487.   if inFile is empty then exit mouseUp
  488.   set cursor to watch
  489.   ReadBibTeX inFile
  490.   if the result is not empty then
  491.     answer the result with "OK"
  492.   end if
  493. end mouseUp
  494.  
  495.  
  496.  
  497. -- part 103 (button)
  498. -- low flags: 00
  499. -- high flags: A004
  500. -- rect: left=96 top=305 right=335 bottom=201
  501. -- title width / last selected line: 0
  502. -- icon id / first selected line: 0 / 0
  503. -- text alignment: 1
  504. -- font id: 0
  505. -- text size: 12
  506. -- style flags: 0
  507. -- line height: 16
  508. -- part name: Write Strings…
  509. ----- HyperTalk script -----
  510. on mouseUp
  511.   put StdFile(put, "Save to Strings file:") into newFile
  512.   if newFile is empty then exit mouseUp
  513.   set cursor to watch
  514.   WriteBibTeX newFile, "Other", "yes"
  515. end mouseUp
  516.  
  517.